// Tuple3.java
// Andrew Davison, November 2006, ad@fivedots.coe.psu.ac.th

/* A tuple of 3 elements, which can be used to
 store a vertex, normal, or texture coord.
 */

package mx.com.crowdgine.assetloader;

import mx.com.crowdgine.util.math.Vector3f;

public class Tuple3 {
	private float x, y, z;

	public Tuple3(float xc, float yc, float zc) {
		x = xc;
		y = yc;
		z = zc;
	}
	
	public void add(Vector3f qt){
		x += qt.getX();
		y += qt.getY();
		z += qt.getZ();
	}

	public String toString() {
		return "( " + x + ", " + y + ", " + z + " )";
	}

	public void setX(float xc) {
		x = xc;
	}

	public float getX() {
		return x;
	}

	public void setY(float yc) {
		y = yc;
	}

	public float getY() {
		return y;
	}

	public void setZ(float zc) {
		z = zc;
	}

	public float getZ() {
		return z;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Tuple3) {
			
			Tuple3 other = (Tuple3) obj;
			
			return this.x == other.getX() && this.y == other.getY() && this.z == other.getZ();
			
		} else {
			return false;
		}
	}

} // end of Tuple3 class